#include <stdio.h>
#include <string.h>
#include <stdbool.h>

bool detectCapitalUse(char* word) 
{
    int len =strlen(word);
    if(word[0] >= 'A' && word[0] <= 'Z' && word[1] >= 'A' && word[1] <= 'Z')
    {
        for(int i = 2;i < len;i++)
        {
            if(word[i] >= 'a' && word[i] <= 'z')
                return false;
        }
    }
    if(word[0] >= 'A' && word[0] <= 'Z' && word[1] >= 'a' && word[1] <= 'z')
    {
        for(int i = 2;i < len;i++)
        {
            if(word[i] >= 'A' && word[i] <= 'Z')
                return false;
        }
    }
    if(word[0] >= 'a' && word[0] <= 'a' && word[1] >= 'a' && word[1] <= 'z')
    {
        for(int i = 2;i < len;i++)
        {
            if(word[i] >= 'A' && word[i] <= 'Z')
                return false;
        }
    }
    return true;
}

int main()
{
    char word[] = "gbca";
    if(detectCapitalUse(word))
        printf("okkk");
    else
        printf("noooo");

}